#!/bin/bash
################################
#RabbitMQ Cluster群集安装配置

read -p "input cluster first node hostname:" nodename

#controller2、controller3执行加入节点controller1
systemctl stop rabbitmq-server
pkill beam.smp
rabbitmq-server -detached 
rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@$nodename
rabbitmqctl start_app
rabbitmqctl cluster_status
#